home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d1
/
basictut.arc
/
AVERAGE.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-01-07
|
384b
|
8 lines
10 DATA 76,93,88,69,100,75,84,999
20 READ NUM:IF NUM=999 THEN GOTO 100 'get a number, check if last number
30 COUNT=COUNT+1 'count the number of numbers
40 SUM=SUM+NUM 'find the sum of the numbers
50 GOTO 20 'get the next number
100 PRINT "The sum of the";COUNT;"numbers is";SUM
110 PRINT "and the average is";SUM/COUNT
'get the next n